<!DOCTYPE html>
<html>
<head>
	<title>车辆详情</title>
	<meta http-equiv="Pragma" CONTENT="no-cache">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="renderer" content="webkit">
	<%include("/common/include.html"){}%>
<style type="text/css">
	#customInfo li{
		display: inline-block;
		width: 165px;
		height: 30px;
		position: relative;
		margin-top: 5px;
	}
	#customInfo li div{
		position: absolute;
		right: 0px;
	}
	input {
		border: 1px solid black;
	}
	.table td {
		padding: 5px;
	}
	.name{
	background: #bad0ff;
	}
</style>

</head>
	<body>
		<div class="easyui-layout" style="width:100%;height:100%;">
		<form id="info_form" method="post" enctype="multipart/form-data">
			<div data-options="region:'center'"  style="OVERFLOW-X:hidden;">
				<!-- <div class="easyui-layout" style="width:100%;"> -->
				
				
				
					<table class="table" width="100%"  border="1">
						<tr>
							<td colspan="8">
								<div style="margin-left:5px;font-weight: bold;font-size:18px;">车辆所有人信息</div>
							</td>
						</tr>
						
						<tr>
							<td width="10%" style="text-align: right;" class="name">所有人性质</td>
							<td width="15%" >
							${owner.OWNERTYPE}
							</td>
							<td width="10%" style="text-align: right;" class="name">所有人名称</td>
							<td width="15%">${owner.OWNERNAME}</td>
							<% if(owner.OWNERTYPE=='个人'){ %>
							<td width="10%" style="text-align: right;" class="name" id = "td_sfzmhm" >身份证号码</td>
							<%}else{%>
							<td width="10%" style="text-align: right;" class="name" id = "td_sfzmhm" >社会信用代码</td>
							<% } %>
							<td width="15%">${owner.SFZHM !}</td>
							<!-- <td width="10%" style="text-align: right;" class="name">身份证号码</td>
							<td width="15%">${owner.SFZHM !}</td>
							<td width="10%" style="text-align: right;" class="name">社会信用代码</td>
							<td width="15%">${owner.SHXYDM !}</td> -->
						</tr>
					
						<tr>
							<td style="text-align: right;" class="name">是否老年</td>
							<td width="15%">
								${owner.SFLN !}
							</td>
							<td width="10%" style="text-align: right;" class="name">老年证编号</td>
							<td width="15%">${owner.LNNUM !}</td>
							<td style="text-align: right;" class="name">是否残疾</td>
							<td width="15%">
								${owner.SFCJ !}
							</td>
							<td width="10%" style="text-align: right;" class="name">残疾证编号</td>
							<td width="15%">${owner.CJNUM !}</td>
						</tr>
						
						<tr>
							<td style="text-align: right;" class="name">行政区划</td>
							<td width="15%">
								${owner.ADDRESS !}
							</td>
							<td style="text-align: right;" class="name">详细地址</td>
							<td width="15%">${owner.DETAILADDRESS !}</td>
							<td style="text-align: right;" class="name">座机</td>
							<td width="15%">${owner.TEL !}</td>
							<td style="text-align: right;" class="name">手机</td>
							<td width="15%">${owner.PHONE !}</td>
						</tr>
					
						<tr>
							<td colspan="8">
								<div style="margin-left:5px;font-weight: bold;font-size:18px;">车辆参数信息</div>
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="name">车辆类型</td>
							<td width="15%" colspan="8">
							${vehicleparemeters.CLLX !}
							
							</td>
						</tr>
						<tr>
							<td style="text-align: right" class="name">车辆识别代号</td>
							<td>${vehicleparemeters.CLSBDH !}</td>
							<td style="text-align: right;" class="name">使用性质</td>
							<td width="15%">
							${vehicleparemeters.SYXZ !}
							
							
								
							</td>
							<td style="text-align: right;" class="name">车辆品牌</td>
							<td>${vehicleparemeters.CLPP !}</td>
							
							<td style="width: 10%;text-align: right" class="name">车辆型号</td>
							<td>${vehicleparemeters.CLXH !}</td>
							
						</tr>
					
						<tr>
							<td style="text-align: right" class="name">生产厂家</td>
							<td>${vehicleparemeters.SCCJ !}</td>
							<td style="text-align: right;" class="name">出厂日期</td>
							<td>${vehicleparemeters.CCRQ !}
							</td>
							<td style="text-align: right;" class="name">合格证编号</td>
							<td>${vehicleparemeters.HGZBH !}    </td>
							<td style="text-align: right;" class="name">使用年限/年</td>
							<td> ${vehicleparemeters.SYNX !}</td>
						</tr>
					
						<tr>
							<td style="text-align: right;" class="name">车身颜色</td>
							<td>
								${vehicleparemeters.CSYS !}
							</td>
							<td style="text-align: right;" class="name">前后轮距/CM</td>
							<td>${vehicleparemeters.QHLJ !}</td>
							<td style="text-align: right;" class="name">车体宽度/CM</td>
							<td>${vehicleparemeters.CTKD !}</td>
							<td style="text-align: right;" class="name">整车质量/Kg</td>
							<td>${vehicleparemeters.ZCZL !}</td>
						</tr>
					
						<tr>
							<td style="text-align: right;" class="name">核定载人数</td>
							<td>${vehicleparemeters.HDZRS !}</td>
							<td style="text-align: right;" class="name">功率/W</td>
							<td>${vehicleparemeters.GL !}</td>
							<td style="text-align: right;" class="name">是否加装遮雨棚</td>
							<td>
								${vehicleparemeters.SFJZYP !}
							</td>
							<td style="text-align: right;" class="name">是否加装载物箱</td>
							<td>
								${vehicleparemeters.SFJZZWX !}
							</td>
						</tr>
					
						<tr>
							<td colspan="8">
								<div style="margin-left:5px;font-weight: bold;font-size:18px;">车辆号牌信息</div>
							</td>
						</tr>
					
						<tr>
							<td style="text-align: right;" class="name">号牌号码</td>
							<td colspan="8">${plate.HPHM!}</td>
						</tr>
					
					<!-- 	<tr>
							<td colspan="8">
								<div style="margin-left:5px;font-weight: bold;font-size:18px;">业务照片信息</div>
							</td>
						</tr> -->
						
					<!-- 	<tr align="center">
							<td colspan="2" style="padding-top:10px;" width="15%" align="center"><img id="xmTanImg1" width="240px" 
								height="240px" /> 
								<div>来历凭证</div>
								</td>
							<td colspan="2" style="padding-top:10px;" width="15%" align="center"><img id="xmTanImg2" width="240px" 
									height="240px" /> 
									<div>合格证</div>
									</td>
							<td colspan="2" style="padding-top:10px;" width="15%" align="center"><img id="xmTanImg3" width="240px" 
									height="240px" />
									
									<div>车辆</div>
									</td>
							<td colspan="2" style="padding-top:10px;" width="15%" align="center"><img id="xmTanImg4" width="240px" 
									height="240px" />
									<div>其他</div>
									</td>
						</tr> -->
					</table>
				<!-- </div>	 -->
				
			</div>
		</form>
		</div>
	</body>
</html>

<script type="text/javascript">

	$(function(){
		$("#OWNERTYPE").val('${owner.OWNERTYPE !}');
		$("#SFLN").val('${owner.SFLN !}');
		$("#SFCJ").val('${owner.SFCJ !}');
		$("#ADDRESS").val('${owner.ADDRESS !}');
		
		$("#CLLX").val('${vehicleparemeters.CLLX !}');
		$("#SYXZ").val('${vehicleparemeters.SYXZ !}');
		$("#CSYS").val('${vehicleparemeters.CSYS !}');
		$("#SFJZYP").val('${vehicleparemeters.SFJZYP !}');
		$("#SFJZZWX").val('${vehicleparemeters.SFJZZWX !}');
	});
	
	$("#CLXH").combobox({
		onChange: function(n, o) {
			cllx(n)
		}
	});
	
	function cllx(val) {
		$.ajax({
			cache: true,
			type: "POST",
			url: "${cxt !}/ywsl/getclxx",
			data: {
				cllx: val
			}, // 你的formid
			dataType: 'json',
			async: false,
			success: function(result) {
				//alert(JSON.stringify(result))
				if(result != null) {
					$("#CWKC").val(result.chang);
					$("#CWKK").val(result.width);
					$("#CWKG").val(result.height);
					$("#CLLX").val(result.type);
					$("#CLXH").val(result.model);
					$("#CLPP1").val(result.pp);
					$("#ZZCMC").val(result.manu_contry);
					$("#CSYS").val(result.color);
					$("#ccrq").val(result.ccrq)
					$("#GL").val(result.gl);
					$("#ZZL").val(result.weight);
					$("#CCRQ").val(result.birthday);
				}
			}
		});
	}
	

	//选择图片，马上预览
	function xmTanUploadImg(obj, id) {
		var file = obj.files[0];

		console.log(obj);
		console.log(file);
		console.log("file.size = " + file.size); //file.size 单位为byte

		var reader = new FileReader();

		//读取文件过程方法
		reader.onloadstart = function(e) {
			console.log("开始读取....");
		}
		reader.onprogress = function(e) {
			console.log("正在读取中....");
		}
		reader.onabort = function(e) {
			console.log("中断读取....");
		}
		reader.onerror = function(e) {
			console.log("读取异常....");
		}
		reader.onload = function(e) {
			console.log("成功读取....");

			var img = document.getElementById(id);
			img.src = e.target.result;
			//或者 img.src = this.result;  //e.target == this
		}

		reader.readAsDataURL(file)
	}
</script>
<script>
	function hqnl(idCard) {
		var birthday = "";
		if(idCard != null && idCard != "") {
			if(idCard.length == 15) {
				birthday = "19" + idCard.substr(6, 6);
			} else if(idCard.length == 18) {
				birthday = idCard.substr(6, 8);
			}

			birthday = birthday.replace(/(.{4})(.{2})/, "$1-$2-");
		}
		var nl = ages(birthday);
		$("#nl").val(nl)

	}

	function ages(str) {
		var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
		if(r == null)
			return false;
		var d = new Date(r[1], r[3] - 1, r[4]);
		if(d.getFullYear() == r[1] && (d.getMonth() + 1) == r[3] &&
			d.getDate() == r[4]) {
			var Y = new Date().getFullYear();
			return(Y - r[1]);
		}
		return(0);
	}

	function uploadImage2(file_url) {
		/* var filePath = $('#file_url').val(); */
		alert(file_url);
		$.ajax({
			cache: true,
			type: "POST",
			url: "${cxt !}/upload",
			data: {
				"filePath": file_url
			},
			dataType: 'json',
			async: false,
			success: function(result) {
				if(result.msg == '上传成功') {
					$.slideMsg("上传成功", parent.$);
					location.reload();
				} else {
					$.alert(parent.$, result.msg);
				}
			}
		});
	}

	/*上传*/
	function file(f) {

		if(f.value != '') {
			var formData = new FormData($("#work4")[0]);
			$.ajax({
				url: "${cxt !}/upload",
				type: 'post',
				data: formData,
				async: false,
				cache: false,
				contentType: false,
				processData: false,
				dataType: "json",
				success: function(returndata) {
					if(returndata.status == 1) {
						document.getElementById("imageName").value = returndata.filename;
						document.getElementById("picture").value = returndata.picturePath;
						var a = $(f).parent().find('span').text(f.value.substring

(f.value.lastIndexOf('\\') + 1, f.value.lenght));
						layer.msg('上传成功!');
					} else if(returndata.status == 2) {
						layer.msg('文件大小超过100M!');
					} else if(returndata.status == 3) {
						layer.msg('文件格式不正确!');
					} else {
						layer.msg('上传失败!');
					}
				},
				error: function(returndata) {
					layer.msg('上传失败!');
				}
			});
		}
	}
</script>
